<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-fl">设备</div>
                    <div class="widget-function am-fr">
                        <a href="javascript:;" class="am-icon-cog"></a>
                    </div>
                </div>
                <div class="widget-body am-fr">
                    <form class="am-form tpl-form-line-form" id="deviceForm" method="post"
                          enctype="multipart/form-data">
                        <!--串号(mac)-->
                        <div class="am-form-group">
                            <label for="mac" class="am-u-sm-2 am-form-label">串号
                                <span class="tpl-form-line-small-title">mac</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="mac" class="tpl-form-input" placeholder="请输入" name="mac"
                                       th:value="${record.mac != null} ? ${record.mac} : ''"/>
                            </div>
                        </div>
                        <!--设备名称(device_name)-->
                        <div class="am-form-group">
                            <label for="deviceName" class="am-u-sm-2 am-form-label">设备名称
                                <span class="tpl-form-line-small-title">deviceName</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="deviceName" class="tpl-form-input" placeholder="请输入"
                                       name="deviceName"
                                       th:value="${record.deviceName != null} ? ${record.deviceName} : ''"/>
                            </div>
                        </div>
                        <!--设备厂商(device_firm)-->
                        <div class="am-form-group">
                            <label for="deviceFirm" class="am-u-sm-2 am-form-label">设备厂商
                                <span class="tpl-form-line-small-title">deviceFirm</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="deviceFirm" class="tpl-form-input" placeholder="请输入"
                                       name="deviceFirm"
                                       th:value="${record.deviceFirm != null} ? ${record.deviceFirm} : ''"/>
                            </div>
                        </div>
                        <!--设备型号(spouse_identification)-->
                        <div class="am-form-group">
                            <label for="model" class="am-u-sm-2 am-form-label">设备型号
                                <span class="tpl-form-line-small-title">model</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="model" class="tpl-form-input" placeholder="请输入" name="model"
                                       th:value="${record.model != null} ? ${record.model} : ''"/>
                            </div>
                        </div>
                        <!--拥有人(owner)-->
                        <div class="am-form-group">
                            <label for="owner" class="am-u-sm-2 am-form-label">拥有人
                                <span class="tpl-form-line-small-title">owner</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="owner" class="tpl-form-input" placeholder="请输入" name="owner"
                                       th:value="${record.owner != null} ? ${record.owner} : ''"/>
                            </div>
                        </div>
                        <!--插入时间(insert_time)-->
                        <div class="am-form-group">
                            <label for="insertTime" class="am-u-sm-2 am-form-label">插入时间
                                <span class="tpl-form-line-small-title">insertTime</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="date" id="insertTime" class="tpl-form-input" placeholder="请输入"
                                       name="insertTime"
                                       th:value="${record.insertTime != null} ? ${record.insertTime} : ''"/>
                            </div>
                        </div>
                        <!--新增 人员(insertPerson)-->
                        <div class="am-form-group">
                            <label for="insertPerson" class="am-u-sm-2 am-form-label">新增人员
                                <span class="tpl-form-line-small-title">insertPerson</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="insertPerson" class="tpl-form-input" placeholder="请输入"
                                       name="insertPerson"
                                       th:value="${record.insertPerson != null} ? ${record.insertPerson} : ''"/>
                            </div>
                        </div>
                        <!--修改时间(insertPerson)-->
                        <div class="am-form-group">
                            <label for="updateTime" class="am-u-sm-2 am-form-label">修改时间
                                <span class="tpl-form-line-small-title">updateTime</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="date" id="updateTime" class="tpl-form-input" placeholder="请输入"
                                       name="updateTime"
                                       th:value="${record.updateTime != null} ? ${record.updateTime} : ''"/>
                            </div>
                        </div>
                        <!--修改人(updatePerson)-->
                        <div class="am-form-group">
                            <label for="updatePerson" class="am-u-sm-2 am-form-label">修改人
                                <span class="tpl-form-line-small-title">updatePerson</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="updatePerson" class="tpl-form-input" placeholder="请输入"
                                       name="updatePerson"
                                       th:value="${record.updatePerson != null} ? ${record.updatePerson} : ''"/>
                            </div>
                        </div>
                        <!--操作-->
                        <div class="am-form-group">
                            <div class="am-u-sm-10 am-u-sm-push-2">

                                <button type="button" onclick="return doSubmit();"
                                        class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交
                                </button>
                                <button type="button" onclick="loadPage('device/listUI')"
                                        class="am-btn am-btn-success tpl-btn-bg-color-success ">返回
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>
<script th:inline="javascript">
    <![CDATA[
    //$('select').selected();
    validateUserForm();

    function validateUserForm() {
        valdater = $('#deviceForm').validate({
            errorElement: 'span',
            errorClass: 'am-icon-times',
            focusInvalid: true,
            onkeyup: false,
            ignore: "",
            rules: {
                title: {
                    required: true
                }
            },
            messages: {
                name: {
                    required: "请填写标题"
                }
            }
        });
    }

    function doSubmit() {
        if (valdater.form()) {
            commit('deviceForm', 'device/save', 'device/listUI');
            return true;
        }
        return false;
    }

    ]]>
</script>
<script type="text/javascript" th:src="@{/My97DatePicker/WdatePicker.js}"/>